public class Solution {
    public int maxDepth(TreeNode root) {
        if (root == null) return 0;
        int leftH =maxDepth(root.left);
        int rightH = maxDepth(root.right);
        return leftH > rightH ? leftH + 1 : rightH + 1;
    }
}
